import { Controller, Get, Query, Param, Post, Body } from '@nestjs/common';
import { FriendService } from './friend.service';
import { UserMap } from './entity/friend.entity';

@Controller()
export class FriendController {
  constructor(private readonly friendService: FriendService) {}

  /**获取好友信息 */
  @Get('/friend/:uid')
  getFriends(
    @Param() uid: string
  ) {
    return this.friendService.getFriends(uid);
  }

  /**判断两人是否为好友 */
  @Post('/isFriend')
  isFriend(
    @Body() uids: UserMap
  ) {
    return this.friendService.isFriend(uids);
  }

}